import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../index.vue'
import Login from '../login.vue'
import Repository from '../repository.vue'

Vue.use(VueRouter);


const routes = [
  {
    path: '',
    name: '',
    component: Index
  },
  {
    path: '/repository',
    name: 'repository',
    meta: {
      requireAuth: true,  // 添加该字段，表示进入这个路由是需要登录的
    },
    component: Repository
  },
  {
    path: '/login',
    name: 'login',
    component: Login
  }
];

const router = new VueRouter({
  routes
});

export default router;
